#flash_warning{ class: 'flash warning' }= l(:notice_empty_repository)

- if @repository.urls_are_viewable?
  - content_for :header_tags do
    = stylesheet_link_tag 'application', plugin: 'redmine_git_hosting'

  .git_hosting_urls.box
    .container
      .row
        .col-md-8{ style: 'vertical-align: middle;' }
          = render 'common/git_urls', repository: @repository
        .col-md-4{ style: 'text-align: right; vertical-align: middle;' }

.box
  - if User.current.allowed_to?(:view_changesets, @project)
    %h2= l(:label_help_git_setup) + ' :'
    %pre
      :preserve
          #{link_to l(:label_download_and_install_git), 'http://git-scm.com/download', target: '_blank'}
          git config --global user.name "#{User.current.name(:firstname_lastname)}"
          git config --global user.email #{User.current.mail ? User.current.mail : "mail@example.com"}
          #{link_to "Upload SSH Public Key", { controller: 'my', action: 'account' } if !User.current.anonymous? && User.current.gitolite_public_keys.length == 0}

    - if User.current.allowed_to?(:commit_access, @project)
      #repository_setup
        %h2= l(:label_help_repository_setup_new) + ' :'
        %pre
          :preserve
              mkdir #{@repository.redmine_name}
              cd #{@repository.redmine_name}
              git init
              touch readme.txt
              git add readme.txt
              git commit -m 'Initializing #{@repository.redmine_name} repository'
              git remote add origin <span class="git_url_access"></span>
              git push -u origin master

        %h2= l(:label_help_repository_setup_existing) + ' :'
        %pre
          :preserve
              cd existing_git_repo
              git remote add origin <span class="git_url_access"></span>
              git push -u origin master

      %h2= l(:label_help_repository_clone) + ' :'
      %pre
        :preserve
            git clone <span class="git_url_access"></span>

  - else

    = l(:label_help_no_repo_rights)


- content_for :sidebar do
  %h3= l(:label_repository_plural)
  %ul{ class: 'repository git' }
    - @repositories.sort.each do |repo|
      %li{ class: 'repository git' }
        = link_to_repository(repo, @repository)
        = link_to "(#{l(:label_settings)})", edit_repository_path(repo) if User.current.allowed_to?(:manage_repository, @project)

:javascript
  $(document).ready(function() { setGitUrlsInstructions('.git_url'); });
